<script setup lang="ts">
import { ref } from 'vue';
import { MdEditor } from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';

const text = ref('# Hello Editor');
const submit = () => {
  console.log(text);
};
const onUploadImg = (files: any) => {
  console.log(files);
};
</script>

<template>
  <div class="container">
    <MdEditor v-model="text" @on-upload-img="onUploadImg" />
    <el-button style="margin-top: 20px" type="primary" @click="submit">提交</el-button>
  </div>
</template>

<style lang="scss" scoped>
// ...
</style>
